Optimal. Leaf size=110 \[ -\frac {2 a^3 (A-i B) \tan (e+f x)}{f}-\frac {4 a^3 (B+i A) \log (\cos (e+f x))}{f}+4 a^3 x (A-i B)+\frac {a (B+i A) (a+i a \tan (e+f x))^2}{2 f}+\frac {B (a+i a \tan (e+f x))^3}{3 f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.09, antiderivative size = 110, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3527, 3478, 3477, 3475} \[ -\frac {2 a^3 (A-i B) \tan (e+f x)}{f}-\frac {4 a^3 (B+i A) \log (\cos (e+f x))}{f}+4 a^3 x (A-i B)+\frac {a (B+i A) (a+i a \tan (e+f x))^2}{2 f}+\frac {B (a+i a \tan (e+f x))^3}{3 f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3475
Rule 3477
Rule 3478
Rule 3527
Rubi steps
\begin {align*} \int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) \, dx &=\frac {B (a+i a \tan (e+f x))^3}{3 f}-(-A+i B) \int (a+i a \tan (e+f x))^3 \, dx\\ &=\frac {a (i A+B) (a+i a \tan (e+f x))^2}{2 f}+\frac {B (a+i a \tan (e+f x))^3}{3 f}+(2 a (A-i B)) \int (a+i a \tan (e+f x))^2 \, dx\\ &=4 a^3 (A-i B) x-\frac {2 a^3 (A-i B) \tan (e+f x)}{f}+\frac {a (i A+B) (a+i a \tan (e+f x))^2}{2 f}+\frac {B (a+i a \tan (e+f x))^3}{3 f}+\left (4 a^3 (i A+B)\right ) \int \tan (e+f x) \, dx\\ &=4 a^3 (A-i B) x-\frac {4 a^3 (i A+B) \log (\cos (e+f x))}{f}-\frac {2 a^3 (A-i B) \tan (e+f x)}{f}+\frac {a (i A+B) (a+i a \tan (e+f x))^2}{2 f}+\frac {B (a+i a \tan (e+f x))^3}{3 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 4.09, size = 331, normalized size = 3.01 \[ \frac {a^3 \sec (e) \sec ^3(e+f x) \left (3 \cos (f x) \left ((-3 B-3 i A) \log \left (\cos ^2(e+f x)\right )+6 A f x-i A-6 i B f x-3 B\right )+3 \cos (2 e+f x) \left ((-3 B-3 i A) \log \left (\cos ^2(e+f x)\right )+6 A f x-i A-6 i B f x-3 B\right )+9 A \sin (2 e+f x)-9 A \sin (2 e+3 f x)+6 A f x \cos (2 e+3 f x)+6 A f x \cos (4 e+3 f x)-3 i A \cos (2 e+3 f x) \log \left (\cos ^2(e+f x)\right )-3 i A \cos (4 e+3 f x) \log \left (\cos ^2(e+f x)\right )-18 A \sin (f x)-15 i B \sin (2 e+f x)+13 i B \sin (2 e+3 f x)-6 i B f x \cos (2 e+3 f x)-6 i B f x \cos (4 e+3 f x)-3 B \cos (2 e+3 f x) \log \left (\cos ^2(e+f x)\right )-3 B \cos (4 e+3 f x) \log \left (\cos ^2(e+f x)\right )+24 i B \sin (f x)\right )}{12 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.77, size = 178, normalized size = 1.62 \[ \frac {{\left (-24 i \, A - 48 \, B\right )} a^{3} e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (-42 i \, A - 66 \, B\right )} a^{3} e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (-18 i \, A - 26 \, B\right )} a^{3} + {\left ({\left (-12 i \, A - 12 \, B\right )} a^{3} e^{\left (6 i \, f x + 6 i \, e\right )} + {\left (-36 i \, A - 36 \, B\right )} a^{3} e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (-36 i \, A - 36 \, B\right )} a^{3} e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (-12 i \, A - 12 \, B\right )} a^{3}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )}{3 \, {\left (f e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 1.41, size = 333, normalized size = 3.03 \[ \frac {-12 i \, A a^{3} e^{\left (6 i \, f x + 6 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 12 \, B a^{3} e^{\left (6 i \, f x + 6 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 36 i \, A a^{3} e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 36 \, B a^{3} e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 36 i \, A a^{3} e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 36 \, B a^{3} e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 24 i \, A a^{3} e^{\left (4 i \, f x + 4 i \, e\right )} - 48 \, B a^{3} e^{\left (4 i \, f x + 4 i \, e\right )} - 42 i \, A a^{3} e^{\left (2 i \, f x + 2 i \, e\right )} - 66 \, B a^{3} e^{\left (2 i \, f x + 2 i \, e\right )} - 12 i \, A a^{3} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 12 \, B a^{3} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 18 i \, A a^{3} - 26 \, B a^{3}}{3 \, {\left (f e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.02, size = 160, normalized size = 1.45 \[ -\frac {i a^{3} B \left (\tan ^{3}\left (f x +e \right )\right )}{3 f}-\frac {i a^{3} A \left (\tan ^{2}\left (f x +e \right )\right )}{2 f}+\frac {4 i a^{3} B \tan \left (f x +e \right )}{f}-\frac {3 a^{3} B \left (\tan ^{2}\left (f x +e \right )\right )}{2 f}-\frac {3 a^{3} A \tan \left (f x +e \right )}{f}+\frac {2 i a^{3} A \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{f}+\frac {2 a^{3} B \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{f}-\frac {4 i a^{3} B \arctan \left (\tan \left (f x +e \right )\right )}{f}+\frac {4 a^{3} A \arctan \left (\tan \left (f x +e \right )\right )}{f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.66, size = 96, normalized size = 0.87 \[ -\frac {2 i \, B a^{3} \tan \left (f x + e\right )^{3} - {\left (-3 i \, A - 9 \, B\right )} a^{3} \tan \left (f x + e\right )^{2} - 24 \, {\left (f x + e\right )} {\left (A - i \, B\right )} a^{3} - 6 \, {\left (2 i \, A + 2 \, B\right )} a^{3} \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + 6 \, {\left (3 \, A - 4 i \, B\right )} a^{3} \tan \left (f x + e\right )}{6 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 8.91, size = 125, normalized size = 1.14 \[ -\frac {{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {B\,a^3}{2}+\frac {a^3\,\left (2\,B+A\,1{}\mathrm {i}\right )}{2}\right )}{f}+\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (4\,B\,a^3+A\,a^3\,4{}\mathrm {i}\right )}{f}+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (B\,a^3\,1{}\mathrm {i}-a^3\,\left (2\,A-B\,1{}\mathrm {i}\right )+a^3\,\left (2\,B+A\,1{}\mathrm {i}\right )\,1{}\mathrm {i}\right )}{f}-\frac {B\,a^3\,{\mathrm {tan}\left (e+f\,x\right )}^3\,1{}\mathrm {i}}{3\,f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [B] time = 0.73, size = 187, normalized size = 1.70 \[ - \frac {4 i a^{3} \left (A - i B\right ) \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{f} + \frac {18 A a^{3} - 26 i B a^{3} + \left (42 A a^{3} e^{2 i e} - 66 i B a^{3} e^{2 i e}\right ) e^{2 i f x} + \left (24 A a^{3} e^{4 i e} - 48 i B a^{3} e^{4 i e}\right ) e^{4 i f x}}{3 i f e^{6 i e} e^{6 i f x} + 9 i f e^{4 i e} e^{4 i f x} + 9 i f e^{2 i e} e^{2 i f x} + 3 i f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________